package com.wanxi.reflect;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class GetMethod {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName("com.wanxi.reflect.Student");
        Constructor<?> constructor = aClass.getConstructor();
//        int modifiers = constructor.getModifiers();
//        System.out.println(modifiers);
        Object o = constructor.newInstance();
        Method[] methods = aClass.getDeclaredMethods();
        for (Method m:methods
             ) {
            System.out.println(m);
        }
        Method study = aClass.getDeclaredMethod("study");
        study.invoke(o);

    }
}
